package fr.cephb.joperon.core.entities;
import javax.xml.bind.annotation.XmlTransient;

import com.sleepycat.db.DatabaseEntry;
import com.sleepycat.db.DatabaseException;
import fr.cephb.joperon.core.entities.base.BaseSnpMap;


/**
 * SnpMap
 * Description: SNP map (ref.)
 */
public class SnpMap
	extends BaseSnpMap
	{
	/* categories coded by getCat() */
	public static enum CATEGORY
		{
		UNK,
		SNP,DEL,INS,TRI,REP,MNP
		};
	
		/* categories coded by getCat() \
		 *  ATTENTION PROBLEME A FIXER !!
		 * 
		 * */
		public static enum ORIENTATION
			{
			Reverse,
			Forward,
			UNK
			};
		
		
	/**
     *
     * Constructor
     *
     */
	public SnpMap()
		{
		super();
		}


        /**
         *
         * Copy Constructor
         *
         */
		public SnpMap(BaseSnpMap cp)
			{
			super(cp);
			}
		
		/**
		 * constructor from a database entry
		 *
		 */
		public SnpMap(DatabaseEntry entry) throws DatabaseException
			{
			super(entry);
			}
		
		
        /**
         *
         * clone
         *
         */
		public Object clone()
			{
			return new SnpMap(this);
			}

		@XmlTransient
		public CATEGORY getCategory()
			{
			if(getCat()<0 || getCat()>= CATEGORY.values().length) return CATEGORY.UNK;
			return CATEGORY.values()[getCat()];
			}
		
		@XmlTransient
		public ORIENTATION getOrientation()
			{
			if(getOri()<0 || getOri()>= CATEGORY.values().length) return ORIENTATION.Reverse;
			return ORIENTATION.values()[getOri()];
			}
		}

